import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../page/home";
import Login from "../page/login";
import Mine from "../page/mine";
import Search from "../page/search";
import Playlist from "../page/playlist";
import Gedandetail from "../page/gedandetail";
import Rank from "../page/rank";
import Fm from "../page/fm";
//每日推荐
import Everyday from "../page/everyday";
Vue.use(VueRouter);
const router = new VueRouter({
  routes: [
    {
      path: "/",
      redirect: "/home",
    },
    //登录
    {
      path: "/login",
      component: Login,
      meta: {
        title: "登录",
        showFooter: false,
        showHeader: true,
        center1: false,
        arrowLeft: true, //返回按钮
      },
    },
    {
      path: "/rank",
      component: Rank,
      meta: {
        showFooter: false,
      },
    },
    {
      path: "/gedandetail/:id",
      component: Gedandetail,
      meta: {
        showFooter: false,
      },
    },
    //每日推荐
    {
      path: "/everyday",
      component: Everyday,
      meta: {
        showFooter: false,
      },
    },
    //点歌播放页面
    {
      path: "/songdetail",
      component: () => import("@/page/home/golist"),

      meta: {
        showFooter: false,
      },
    },
    {
      path: "/playlist",
      component: Playlist,
      meta: {
        showFooter: false,
      },
    },
    {
      path: "/home",
      component: Home,
      name: "Home",
      meta: {
        showFooter: true,
        showHeader: true,
        arrowLeft: false, //返回按钮
        showPopup: true,
      },
    },
    //关注
    {
      path: "/search/:data",
      component: Search,
      name: "Search",
      meta: {
        showFooter: true,
      },
    },
    {
      path: "/like",

      component: () => import("@/page/like/index.vue"),

      meta: {
        title: "",
        showFooter: true,
        showHeader: true,
        center1: false,
        center2: true,
        arrowLeft: false,
        showPopup: true,
      },
      children: [
        {
          //动态

          path: "dynamic",
          component: () => import("@/page/like/dynamic/index.vue"),
          meta: {
            title: "",

            showFooter: true,
            showHeader: true,
            center1: false,
            center2: true,
            showPlay: false,
            showPopup: true,
          },
        },
        {
          //云圈

          path: "cloud",
          component: () => import("@/page/like/cloud/index.vue"),
          meta: {
            title: "",

            showFooter: true,
            showHeader: true,
            center1: false,
            center2: true,
            showPlay: false,
            showPopup: true,
          },
        },
      ],
    },
    {
      path: "/topic/:id",
      component: () => import("../page/like/dynamic/topicitem"),
      meta: {
        title: "话题详情",

        showFooter: false,
        showHeader: true,
        center1: false,
        center2: false,
        showPlay: false,
        arrowLeft: true,
      },
    },
    {
      //播客
      path: "/podcast",
      name: "podcast",
      component: () => import("@/page/podcast"),
      meta: {
        showFooter: true,
        showHeader: true,
        center1: false,
        center2: true,
        arrowLeft: false,
        showPopup: true,
        showPlay: true,
      },

      children: [
        {
          //听听
          path: "listen",

          name: "Listen",
          component: () => import("@/page/podcast/listen/index.vue"),
          meta: {
            showFooter: true,
            showHeader: true,
            showPlay: true,
            center2: true,
            showPopup: true,
          },
        },
        {
          // 推荐
          path: "advice",
          name: "Advice",

          component: () => import("../page/podcast/advice"),
          meta: {
            title: "",
            showFooter: true,
            showHeader: true,
            center1: false,
            center2: true,
            showPlay: true,
            showPopup: true,
          },
        },
        {
          //分类
          path: "classify",
          name: "Classify",
          component: () => import("@/page/podcast/classify/index.vue"),
          meta: {
            showFooter: true,
            showHeader: true,
            showPlay: true,
            center2: true,
            showPopup: true,
          },
        },
      ],
    },
    {
      // 分类详情
      path: "/classifydetail/:id",
      component: () =>
        import("../page/podcast/classify/classifydeatil/index.vue"),
      meta: {},
    },
    {
      path: "/mine",
      name: "Mine",
      component: Mine,
      meta: {
        showFooter: true,
        showHeader: true,
        center1: true,
        center2: false,
        arrowLeft: false, //返回按钮
        showPopup: true,
      },
    },
    {
      path: "/fm",
      name: "fm",
      component: Fm,
      meta: {
        showFooter: false,
        showHeader: false,

        center1: false,
        arrowLeft: false,
        showPopup: true,
      },
    },

    //mine下的子路由
    {
      path: "/creatlist/:id",
      name: "creatlist",
      component: () => import("../page/mine/musiclist/creatlist.vue"),

      meta: {
        title: "创建歌单",
      },
    },

    {
      path: "/liststar/:id",
      name: "liststar",
      component: () => import("../page/mine/musiclist/liststar.vue"),

      meta: {
        title: "收藏歌单",
      },
    },
    //歌单助手
    {
      path: "/listhelper/:id",
      name: "listhelper",
      component: () => import("../page/mine/musiclist/listhelper.vue"),
      meta: {
        title: "歌单助手",
      },
    },
    //从歌单跳到详情页
    {
      path: "/listdetail/:id",
      name: "listdetail/",
      component: () => import(`../page/mine/musiclist/listdetail.vue`),
      meta: {
        title: "歌单详情",
      },
    },
    {
      path: "/personal/",
      name: "personal/",
      component: () => import("../../src/page/personal"),
      meta: {},
    },
    //歌曲详情页面
    {
      path: "/golist/:id",
      name: "golist/",
      component: () => import(`../page/home/golist.vue`),
      meta: {
        title: "歌单详情",
      },
    },
    {
      path: "/gosonglistDetail/:id",
      name: "gosonglistDetail/",
      component: () => import(`../page/home/gosonglistDetail.vue`),
      meta: {
        title: "歌单详情",
      },
    },
  ],
});
export default router;
